home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 400 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  62 lines

  1. Newsgroups: comp.lang.c++
  2. Path: cs.vu.nl!jalten
  3. From: jalten@cs.vu.nl (Alten JP)
  4. Subject: Re: Help,  I'm getting an error I've never seen!
  5. Nntp-Posting-Host: kits.cs.vu.nl
  6. References: <4bo6k5$ia7@iwaynet.iwaynet.net> <30E0E847.14A4@zeta.org.au>
  7. Sender: news@cs.vu.nl
  8. Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
  9. Date: Thu, 4 Jan 1996 11:02:09 GMT
  10. X-Newsreader: TIN [version 1.2 PL2]
  11. Message-ID: <DKnLBM.M4H.0.-s@cs.vu.nl>
  12.  
  13. Ross McKay (rosko@zeta.org.au) wrote:
  14. : THavoK wrote:
  15. : > 
  16. : > I am getting an error, a linker error to be precise,
  17. : > 
  18. : > LINKER ERROR: Segment _TEXT exceeds 64K.
  19. : > 
  20. : > I have tried to compile my program under every memory model and I still continue to get this error, the program itself is only two files, 1 CPP and a .H
  21. : > 
  22. : > can anyone shed any light on this for me?  I have no big arrays or memory allocations?  I'm lost, sort of new to CPP too,
  23. : > 
  24. : > The environment I am using is Borland C++ 3.1  MS-Dos.
  25. : > 
  26. : >                 Thanks in advance
  27. : >                         T.H.
  28.  
  29. : TH, you have lots of string constants! You can resolve this problem by
  30. : making some of them data, placing them in the _DATA segment:
  31.  
  32. :         char someString[] = "This is a string in the data segment";
  33.  
  34. : You may also want to check that your compiler can/does remove duplicate
  35. : strings, e.g. it creates one copy of "string" for the following:
  36.  
  37. :         printf ("string");
  38. :         strcpy (buf, "string");
  39. :         strcmp (buf, "string");
  40.  
  41. This might give some problems though (think about situations 
  42. yourself...)
  43.  
  44. Another solution is:
  45.  
  46. make the static data far data!
  47.  
  48. instead of 
  49.     static char buffer[20480];
  50. use
  51.     static far char buffer[20480];
  52.  
  53. Have fun.
  54.  
  55. Jelle Paul
  56.  
  57. --
  58. +-------------------------------------------------------+
  59. | Jelle Paul Alten                |   jalten@cs.vu.nl   |
  60. | Vrije Universiteit Amsterdam    |                     |
  61. +-------------------------------------------------------+
  62.